package hello;

import java.io.IOException;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;

public class HelloStillPicture extends MIDlet {
	Display display;

	public void startApp() {
		display = Display.getDisplay(this);
		Canvas myCanvas = new SimpleCanvas();
		display.setCurrent(myCanvas);
	}

	public void pauseApp() {
	}

	public void destroyApp(boolean b) {
	}

}

class SimpleCanvas extends Canvas {
	Image myImage;

	SimpleCanvas() {
		try {
			
		
			myImage = Image.createImage("/fakeVideo.png");
		} catch (IOException e) {
			throw new RuntimeException("Unable to load Image: " + e);
		}

	}

	public void paint(Graphics g) {

		g.setGrayScale(255);
		g.fillRect(0, 0, getWidth(), getHeight());

		g.drawImage(myImage, 0, 0, Graphics.TOP | Graphics.LEFT);
		g.drawImage(myImage, getWidth() / 2, getHeight() / 2, Graphics.HCENTER | Graphics.VCENTER);
		g.drawImage(myImage, getWidth(), getHeight(), Graphics.BOTTOM | Graphics.RIGHT);
	}
}
